

import common._conts
import psutil,subprocess,ctypes

def info_cpp():
    so = ctypes.cdll.LoadLibrary(common._conts.DLL_C_PATH)
    print(so.add(2,4))
    so = ctypes.cdll.LoadLibrary(common._conts.DLL_CPP_PATH)
    print(so.min(44,-4))
    print(so.max(44,-4))

def info_cpu():
    print(psutil.cpu_times())
    print(psutil.cpu_count(logical=False))
    print(psutil.cpu_stats())

def info_memory():
    print(psutil.virtual_memory())
    print(psutil.swap_memory())

def info_disk():
    print(psutil.disk_usage("C:/"))
    print(psutil.disk_io_counters())
    print(psutil.disk_partitions())

def info_net():
    print(psutil.net_io_counters())
    print(psutil.net_if_addrs())
    print(psutil.net_if_stats())

def info_pid():
    print(psutil.pids())

def exc(str):
    p = subprocess.Popen(str,shell=True,stdout=subprocess.PIPE,universal_newlines=True);
    p.wait()
    res = p.stdout.readlines();
    for line in res:
        print(line.strip())

